package com.item.model;

import com.item.model.config.KeyPairConfig;
import com.item.model.entity.WxUser;
import com.item.model.util.DateUtil;
import com.item.model.util.RedisUtil;
import com.item.model.util.RsaUtil;
import org.junit.jupiter.api.Test;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import javax.sql.DataSource;
import java.util.Date;
import java.util.concurrent.TimeUnit;


/**
 * 测试自定义配置文件的绑定
 * @author zhang-rongyao
 * @version V1.0
 * @Package com.item
 * @date 2021/7/21 8:57
 */
@SpringBootTest
public class CCC {

    @Autowired
    KeyPairConfig keyPairConfig;

    @Test
    public void aa() throws Exception {

        // RSA签名
        //String sign = RsaUtil.sign(data, privateKey,"utf-8");
        String data = "";
        String sign = "";
        // RSA验签
        boolean result = RsaUtil.verify(data, sign, keyPairConfig.getZhxPublicKey(), "utf-8");
        System.out.print("验签结果:" + result);
    }


}
